package com.bto.solar.work.controller;

import com.bto.solar.work.common.R;
import com.bto.solar.work.service.BtoPermissionService;
import com.bto.solar.work.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 权限表 前端控制器
 * </p>
 *
 * @author adrian
 * @since 2023-08-09
 */
@RestController
@RequestMapping("/permissions")
public class PermissionsController {

    @Autowired
    private BtoPermissionService btoPermissionService;

    /**
     * 返回可创建业务的权限列表(用户管理-新增/编辑界面)
     */
    @GetMapping("/create-permission")
    public R<List<UserVO.Permissions>> getPermissionList() {
        return R.ok(btoPermissionService.getPermissionList());
    }


    /**
     * 获取用户查询可创建业务条件数据(用户管理-查询框-可创建业务权限类型)
     */
    @GetMapping("/query-create-order-category")
    public R<List<UserVO.Permissions>> getOrderCategoryByUserQuery() {
        return R.ok(btoPermissionService.getOrderCategoryByUserQuery());
    }


}
